package org.malred.dao;

import org.malred.Annotations.*;
import org.malred.pojo.TbProduct;

import java.util.List;

public interface IProductDao {
    @Select("select * from tb_product")
    public List<TbProduct> findAll();

    @Select("select * from tb_product where id = #{id}")
    public TbProduct findById(TbProduct product);

    @Update("update tb_product set " +
            "product_name = #{product_name}," +
            "product_time = #{product_time} " +
            "where id = #{id}")
    public int update(TbProduct product);

    @Insert("insert into tb_product(id,product_name,product_time) " +
            "values(#{id},#{product_name},#{product_time})")
    public void insert(TbProduct product);

    @Delete("delete from tb_product where id = #{id}")
    public int delete(TbProduct product);

}
